import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

import adminSysLogin from '../apps/adminsys/login.vue'
import adminSysIndex from '../apps/adminsys/adminIndex.vue'
import adminSys_homne from '../apps/adminsys/pages/home/home.vue'
import adminSys_basedata_dict from '../apps/adminsys/pages/basedata/dict.vue'
import adminSys_basedata_sys from '../apps/adminsys/pages/basedata/sys.vue'
import adminSys_basedata_org from '../apps/adminsys/pages/basedata/org.vue'
import adminSys_basedata_user from '../apps/adminsys/pages/basedata/user.vue'
import adminSys_basedata_powerunit from '../apps/adminsys/pages/basedata/powerunit.vue'
import adminSys_basedata_variant from '../apps/adminsys/pages/basedata/variant.vue'
import adminSys_collecting_datasvr from '../apps/adminsys/pages/collecting/datasvr.vue'
import adminSys_collecting_mqsvr from '../apps/adminsys/pages/collecting/mqsvr.vue'
import adminSys_collecting_ter from '../apps/adminsys/pages/collecting/ter.vue'
import adminSys_collecting_channel from '../apps/adminsys/pages/collecting/channel.vue'
import adminSys_collecting_device from '../apps/adminsys/pages/collecting/device.vue'
import adminSys_collecting_variant from '../apps/adminsys/pages/collecting/variant.vue'
import adminSys_query from '../apps/adminsys/pages/query/query.vue'


import moappLogin from '../apps/adminsys/pages/moapp/login.vue'
import moappIndex from '../apps/adminsys/pages/moapp/index.vue'
import moappMain from '../apps/adminsys/pages/moapp/main.vue'
import moappAbout from '../apps/adminsys/pages/moapp/about.vue'
import moappDetail from '../apps/adminsys/pages/moapp/detail.vue'

const routes = [{
        path: '/',
        name: 'home',
        component: HomeView
    },
    {
        path: '/about',
        name: 'about',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/AboutView.vue')
    }, {
        path: '/sys/login',
        component: adminSysLogin
    }, {
        path: '/sys/',
        component: adminSysIndex,
        children: [{
            path: "home",
            component: adminSys_homne
        }, {
            path: "basedata_dict",
            component: adminSys_basedata_dict
        }, {
            path: "basedata_org",
            component: adminSys_basedata_org
        }, {
            path: "basedata_user",
            component: adminSys_basedata_user
        }, {
            path: "basedata_sys",
            component: adminSys_basedata_sys
        }, {
            path: "basedata_powerunit",
            component: adminSys_basedata_powerunit
        }, {
            path: "basedata_variant",
            component: adminSys_basedata_variant
        }, {
            path: "collecting_datasvr",
            component: adminSys_collecting_datasvr
        }, {
            path: "collecting_mqsvr",
            component: adminSys_collecting_mqsvr
        }, {
            path: "collecting_terminal",
            component: adminSys_collecting_ter
        }, {
            path: "collecting_channel",
            component: adminSys_collecting_channel
        }, {
            path: "collecting_device",
            component: adminSys_collecting_device
        }, {
            path: "collecting_variant",
            component: adminSys_collecting_variant
        }, {
            path: "query",
            component: adminSys_query
        }]
    }, {
        path: "/mo/login",
        component: moappLogin,
    }, {
        path: "/mo/detail",
        component: moappDetail,
    }, {
        path: "/mo/index",
        component: moappIndex,
        children: [{
            path: "main",
            component: moappMain
        }, {
            path: "about",
            component: moappAbout
        }, ]

    }
]

const router = createRouter({
    //history: createWebHistory(process.env.BASE_URL),
    history: createWebHistory('/admin/'),
    //history: createWebHistory(),
    routes
})
export default router